
package com.example.swordjava;


import android.os.Build;

import androidx.annotation.RequiresApi;

import java.util.HashMap;
import java.util.Map;

public class Test76 {

    public static void main(String[] args) {

        int[][] aa = {{1, 2, 3, 4},
                {5, 6, 7, 8},
                {9, 10, 11, 12},
                {13, 14, 15, 16}};

        int a = 1;
        int b = 4;
        int c = 4 * (b - a) / 2;

        System.out.println(Math.pow(1, 10));
        System.out.println(c);

    }

    public class ListNode {
        int val = 0;
        ListNode next = null;

        public ListNode(int val) {
            this.val = val;

        }
    }

    /**
     * JZ76 删除链表中重复的结点
     * <p>
     * 在一个排序的链表中，存在重复的结点，请删除该链表中重复的结点，重复的结点不保留，返回链表头指针。 例如，链表 1->2->3->3->4->4->5  处理后为 1->2->5
     */

    public ListNode deleteDuplication(ListNode pHead) {
        if (pHead == null || pHead.next == null) return pHead;
        ListNode pre = new ListNode(0);
        pre.next = pHead;
        ListNode cur = pre;
        while (cur.next != null && cur.next.next != null) {
            if (cur.next.val == cur.next.next.val) {
                int value = cur.next.val;
                while (cur.next != null && cur.next.val == value) {
                    cur.next = cur.next.next;
                }
            } else {
                cur = cur.next;
            }
        }

        return pre.next;
    }

}














